import { request } from "@/utils";

export const loginAPI = (loginForm) => {
  return request.post("/authorizations", loginForm);
};

export const getProfileAPI = () => {
  return request.get("/user/profile");
};

export const getChannelListAPI = () => {
  return request.get("/channels");
};

export const createArticleAPI = (data) => {
  return request.post("/mp/articles?draft=false", data);
};

export const getArticlsListAPI = (data) => {
  return request.get("/mp/articles", data);
};

export const delArticleDetailAPI = (id) => {
  return request.delete(`/mp/articles/${id}`);
};

export const getArticleDetailAPI = (id) => {
  return request.get(`/mp/articles/${id}`);
};

export const editArticleAPI = (data) => {
  return request.put(`/mp/articles/${data.id}`, data);
};
